package com.magicman.openfeigndemo.demos.feignClient;

import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MyFallbackFactory implements FallbackFactory<DemoFeign> {
    @Override
    public DemoFeign create(Throwable cause) {
        return new DemoFeign() {
            @Override
            public String call() {
                System.out.println("feign调用失败:"+cause.getMessage());
                    return "FallbackFallback,服务没开";
            }
        };
    }
}